<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title th:replace="common/base::pagetitle"></title>
    <link th:replace="common/base::static"/>
</head>
<body>
<div class="layui-form" style="padding: 20px 30px 0 0;">
    <div class="layui-form-item">
        <label class="layui-form-label">推荐人ID</label>
        <div class="layui-input-inline">
            <input type="text" name="parId" th:value="${editInfo.parId}" placeholder="请输入推荐人ID" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">推荐数组</label>
        <div class="layui-input-inline">
            <input type="text" name="cata" th:value="${editInfo.cata}" placeholder="请输入推荐数组" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">唯一识别码</label>
        <div class="layui-input-inline">
            <input type="text" name="code" th:value="${editInfo.code}" placeholder="请输入唯一识别码" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">会员编号</label>
        <div class="layui-input-inline">
            <input type="text" name="users" th:value="${editInfo.users}" placeholder="请输入会员编号" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">密码</label>
        <div class="layui-input-inline">
            <input type="text" name="pwd" th:value="${editInfo.pwd}" placeholder="请输入密码" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">地址</label>
        <div class="layui-input-inline">
            <input type="text" name="addrs" th:value="${editInfo.addrs}" placeholder="请输入地址" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">会员姓名</label>
        <div class="layui-input-inline">
            <input type="text" name="name" th:value="${editInfo.name}" placeholder="请输入会员姓名" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">微信OPENID</label>
        <div class="layui-input-inline">
            <input type="text" name="wxId" th:value="${editInfo.wxId}" placeholder="请输入微信OPENID" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"></label>
        <div class="layui-input-inline">
            <input type="text" name="wxName" th:value="${editInfo.wxName}" placeholder="请输入" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">手机号码</label>
        <div class="layui-input-inline">
            <input type="text" name="mobile" th:value="${editInfo.mobile}" placeholder="请输入手机号码" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"></label>
        <div class="layui-input-inline">
            <input type="text" name="addtime" id="addtime" th:value="${#strings.replace(editInfo.addtime,'T',' ')}" placeholder="请输入" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">银行卡相关信息（银行名称|开户行|户名|卡号）</label>
        <div class="layui-input-inline">
            <input type="text" name="bank" th:value="${editInfo.bank}" placeholder="请输入银行卡相关信息（银行名称|开户行|户名|卡号）" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">身份证号码</label>
        <div class="layui-input-inline">
            <input type="text" name="idcard" th:value="${editInfo.idcard}" placeholder="请输入身份证号码" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">头像图片名称</label>
        <div class="layui-input-inline">
            <input type="text" name="pics" th:value="${editInfo.pics}" placeholder="请输入头像图片名称" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">最后一次登录时间</label>
        <div class="layui-input-inline">
            <input type="text" name="lastLgn" id="lastLgn" th:value="${#strings.replace(editInfo.lastLgn,'T',' ')}" placeholder="请输入最后一次登录时间" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">临时锁定时间</label>
        <div class="layui-input-inline">
            <input type="text" name="lockTime" id="lockTime" th:value="${#strings.replace(editInfo.lockTime,'T',' ')}" placeholder="请输入临时锁定时间" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">会员级别(0普通会员1县代2市代3省代)</label>
        <div class="layui-input-inline">
            <input type="text" name="types" th:value="${editInfo.types}" placeholder="请输入会员级别(0普通会员1县代2市代3省代)" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">状态(1为开通,0为锁定)</label>
        <div class="layui-input-inline">
            <input type="text" name="status" th:value="${editInfo.status}" placeholder="请输入状态(1为开通,0为锁定)" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">是否隐藏</label>
        <div class="layui-input-inline">
            <input type="text" name="hidden" th:value="${editInfo.hidden}" placeholder="请输入是否隐藏" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item layui-hide">
        <input type="button" lay-submit="" lay-filter="kFormSubmit" id="kFormSubmit">
        <input type="text" name="id" th:value="${editInfo.id}" autocomplete="off" class="layui-input">
    </div>
</div>

<script th:replace="common/base::context"></script>
<script th:replace="common/base::mainjs"></script>
<script>
    layui.use(['form', 'laydate'], function () {
        var $ = layui.$, form = layui.form, laydate = layui.laydate;


        laydate.render({
            elem: '#addtime' // 指定元素
            ,type: 'datetime'
        });
        laydate.render({
            elem: '#lastLgn' // 指定元素
            ,type: 'datetime'
        });
        laydate.render({
            elem: '#lockTime' // 指定元素
            ,type: 'datetime'
        });

        //监听提交
        form.on('submit(kFormSubmit)', function(data){
            var field = data.field; //获取提交的字段
            var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引

            var url = field.id ? 'fn/users/edit' : 'fn/users/add';
            //提交 Ajax 成功后，关闭当前弹层并重载表格
            $.ajax({
                type: req.type.post,
                url: BASE_WEB + url,
                data: field,
                async: false,
                success: function (r) {
                    if (r.code === req.status.ok) {
                        // 重载表格
                        parent.layui.table.reload('kContentTable');
                        parent.layer.close(index); //再执行关闭
                    } else {
                        kvfKit.errorMsg(r.msg);
                    }
                }
            });

        });
    })
</script>
</body>
</html>